//package com.demo.simpletestapp.cameratest
//
//import android.content.Context
//import android.util.AttributeSet
//import android.widget.Toast
//import com.ailiwean.core.Result
//import com.ailiwean.core.view.style1.NBZxingView
//import com.google.android.cameraview.AspectRatio
//
///**
// * 文件传输扫码界面
// */
//class FileScanView @JvmOverloads constructor(context: Context, attributeSet: AttributeSet? = null, def: Int = 0) : NBZxingView(context, attributeSet, def) {
//    override fun resultBack(content: Result) {
//        super.resultBack(content)
//        if (content.text.isEmpty()) {
//            Toast.makeText(context, "未扫描到内容", Toast.LENGTH_SHORT).show()
////            context.startActivity(Intent(context, QrcodeTransmissionFileActivity::class.java))
//            return
//        }
////        var bean = Gson().fromJson<IpAndPortData>(content.text, IpAndPortData::class.java)
////        if(bean == null){
////            Toast.makeText(context, "未扫描到内容", Toast.LENGTH_SHORT).show()
////            return
////        }
////        EventBus.getDefault().post(bean)
//    }
//    override fun provideAspectRatio(): AspectRatio {
//        return AspectRatio.of(16, 9)
//    }
//
//    override fun resultBackFile(content: String) {
//        if (content.isEmpty()) {
//            Toast.makeText(context, "未扫描到内容", Toast.LENGTH_SHORT).show()
//        }
//    }
//}